package com.naiterui.ehp.bs.weixin.constant;

import java.util.Arrays;
import java.util.stream.Collectors;
import lombok.Getter;

public interface WeixinConstant {


    /**
     * 中国地区号码编号
     */
    String CHINA_CODE="+86";
    String CODE_CATCHE_PROFIX = "customer|sms_code_";
    int CODE_CATCHE_EXPIRATION = 60 * 10;
    String QR_CODE_DEFAULT_PREFIX = "qrscene_";
    String USER_SESSIONKEY_CACHE = "customer|sessionkey_";
    String USER_JWT_CACHE = "customer|jwt_";
    String MENU_CLICK_VIDEO = "MENU_CLICK_VIDEO";

    interface UserStatus {

        // 正常
        int NORMAL = 1;
        // 待绑定(绑定小程序及手机号)
        int INIT = 2;
        // 禁用
        int TODO = 3;
    }

    @Getter
    public enum WxGenderEnum {
        UNKNOWN(0, "未知"),
        MAN(1, "男性"),
        WOMAN(2, "女性");

        private int gender;
        private String desc;

        WxGenderEnum(int gender, String desc) {
            this.gender = gender;
            this.desc = desc;
        }

        public static String getGenderDesc(int gender) {
            return Arrays.stream(WxGenderEnum.values()).filter(genderEnum -> genderEnum.getGender() == gender).map(WxGenderEnum::getDesc)
                .collect(Collectors.joining());
        }
    }
}
